<script setup lang="ts">
// 消费者运营
import {WxtBizCode, WxtUtils} from "~/contentScripts/views/wxt/lib/wxtUtils";
import CustomerCrowdUnitContent
  from "~/contentScripts/views/wxt/SuperOptimization/KeywordPromotion/CustomerOperationUnitContent.vue";
import CustomerOperationPlanContent
  from "~/contentScripts/views/wxt/SuperOptimization/KeywordPromotion/CustomerOperationPlanContent.vue";
const props = defineProps({
  active: {
    type: String,
    default: 'plan',
  },
});
const type = ref(props.active);
const adzoneList = ref<any[]>([]);
const loadAdzoneList = async () => {
  WxtUtils.customRequest('https://one.alimama.com/component/findList.json', WxtBizCode.精准人群推广, {
    componentCode: 'adzoneList',
  }).then(res => {
    adzoneList.value = res.data.data.list[0].subComponentList[1].subComponentList;
    console.log(adzoneList.value);
  });
};
loadAdzoneList();
// const type = ref('plan');
const bizCode = ref(WxtBizCode["消费者运营-拉新快"]);
</script>

<template>
  <div style="display: flex;flex-direction: column;height: 100%;position:relative;">
    <div style="position: absolute;top: -50px;right: 0">
      <a-radio-group v-model:value="type" size="small" button-style="solid">
        <a-radio-button value="plan">计划列表</a-radio-button>
        <a-radio-button value="unit">单元列表</a-radio-button>
<!--        <a-radio-button value="equity">权益列表</a-radio-button>-->
      </a-radio-group>
    </div>
    <div style="padding-bottom: 10px;">
      <a-radio-group v-model:value="bizCode" button-style="solid">
        <a-radio-button shape="round" :value="WxtBizCode['消费者运营-拉新快']">拉新快</a-radio-button>
        <a-radio-button shape="round" :value="WxtBizCode['消费者运营-会员快']">会员快</a-radio-button>
        <a-radio-button shape="round" :value="WxtBizCode['消费者运营-获客易']">获客易</a-radio-button>
        <a-radio-button shape="round" :value="WxtBizCode['消费者运营-粉丝快']">粉丝快</a-radio-button>
      </a-radio-group>
    </div>
    <div class="box">
      <CustomerOperationPlanContent v-if="type==='plan'" :biz-code="bizCode"/>
      <CustomerCrowdUnitContent v-if="type==='unit'" name="单元" :biz-code="bizCode"/>
    </div>
  </div>
</template>

<style scoped>

.box {
  flex: 1;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
</style>
